Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
Wed Jun 10 06:25:17 1998 Tim Janik <timj@gtk.org>
+ * gdk/gdk.c (gdk_init): prevent gdk_init() from segfaulting when
+ invoked with (NULL, NULL); (this worked sometime ago).
+
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: enum and flags type creation can now be done
through gtk_type_register_enum() and gtk_type_register_flags(),
which allow to specify the enum value arrays directly.
the NULL terminated value arrays can be retrived through
gtk_type_enum_get_values() and gtk_type_flags_get_values();
+ (gtk_type_children_types): new function to query derived types.
1998-06-09 Raja R Harinath <harinath@cs.umn.edu>
/* Private variable declarations
*/
-static int initialized = 0; /* 1 if the library is initialized,
+static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static int connection_number = 0; /* The file descriptor number of our
gint synchronize;
gint i, j, k;
XClassHint *class_hint;
- gint argc_orig = *argc;
- gchar **argv_orig;
+ gchar **argv_orig = NULL;
+ gint argc_orig = 0;
- argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
- for (i = 0; i < argc_orig; i++)
- argv_orig[i] = g_strdup ((*argv)[i]);
- argv_orig[argc_orig] = NULL;
+ if (gdk_initialized)
+ return;
+
+ if (argc && argv)
+ {
+ argc_orig = *argc;
+
+ argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
+ for (i = 0; i < argc_orig; i++)
+ argv_orig[i] = g_strdup ((*argv)[i]);
+ argv_orig[argc_orig] = NULL;
+ }
X_GETTIMEOFDAY (&start);
gdk_progname = g_strdup (d + 1);
else
gdk_progname = g_strdup ((*argv)[0]);
- GDK_NOTE (MISC,
- g_print ("Gdk: progname: \"%s\"\n", gdk_progname));
}
for (i = 1; i < *argc;)
gdk_progname = "<unknown>";
}
+ GDK_NOTE (MISC, g_print ("Gdk: progname: \"%s\"\n", gdk_progname));
+
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
{
gdk_im_open (NULL, NULL, NULL);
#endif
- initialized = 1;
+ gdk_initialized = 1;
}
/*
/* This is to avoid an infinite loop if a program segfaults in
an atexit() handler (and yes, it does happen, especially if a program
has trounced over memory too badly for even g_print to work) */
- if(in_gdk_exit_func == TRUE) return;
+ if (in_gdk_exit_func == TRUE)
+ return;
in_gdk_exit_func = TRUE;
- if (initialized)
+ if (gdk_initialized)
{
#ifdef USE_XIM
/* cleanup IC */
gdk_key_repeat_restore ();
XCloseDisplay (gdk_display);
- initialized = 0;
+ gdk_initialized = 0;
}
}
/* Private variable declarations
*/
-static int initialized = 0; /* 1 if the library is initialized,
+static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static int connection_number = 0; /* The file descriptor number of our
gint synchronize;
gint i, j, k;
XClassHint *class_hint;
- gint argc_orig = *argc;
- gchar **argv_orig;
+ gchar **argv_orig = NULL;
+ gint argc_orig = 0;
- argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
- for (i = 0; i < argc_orig; i++)
- argv_orig[i] = g_strdup ((*argv)[i]);
- argv_orig[argc_orig] = NULL;
+ if (gdk_initialized)
+ return;
+
+ if (argc && argv)
+ {
+ argc_orig = *argc;
+
+ argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
+ for (i = 0; i < argc_orig; i++)
+ argv_orig[i] = g_strdup ((*argv)[i]);
+ argv_orig[argc_orig] = NULL;
+ }
X_GETTIMEOFDAY (&start);
gdk_progname = g_strdup (d + 1);
else
gdk_progname = g_strdup ((*argv)[0]);
- GDK_NOTE (MISC,
- g_print ("Gdk: progname: \"%s\"\n", gdk_progname));
}
for (i = 1; i < *argc;)
gdk_progname = "<unknown>";
}
+ GDK_NOTE (MISC, g_print ("Gdk: progname: \"%s\"\n", gdk_progname));
+
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
{
gdk_im_open (NULL, NULL, NULL);
#endif
- initialized = 1;
+ gdk_initialized = 1;
}
/*
/* This is to avoid an infinite loop if a program segfaults in
an atexit() handler (and yes, it does happen, especially if a program
has trounced over memory too badly for even g_print to work) */
- if(in_gdk_exit_func == TRUE) return;
+ if (in_gdk_exit_func == TRUE)
+ return;
in_gdk_exit_func = TRUE;
- if (initialized)
+ if (gdk_initialized)
{
#ifdef USE_XIM
/* cleanup IC */
gdk_key_repeat_restore ();
XCloseDisplay (gdk_display);
- initialized = 0;
+ gdk_initialized = 0;
}
}
static gboolean iteration_done = FALSE;
static guint main_level = 0;
-static gint initialized = FALSE;
+static gint gtk_initialized = FALSE;
static GdkEvent *next_event = NULL;
static GList *current_events = NULL;
gtk_init (int *argc,
char ***argv)
{
- static gboolean gtk_initialized = FALSE;
gchar *current_locale;
if (gtk_initialized)
return;
- gtk_initialized = TRUE;
if (0)
{
/* Check if there is a good chance the mb functions will handle things
* correctly - set if either mblen("\xc0", MB_CUR_MAX) == 1 in the
- * C locale, or were using X's mb functions. (-DX_LOCALE && locale != C)
+ * C locale, or we're using X's mb functions. (-DX_LOCALE && locale != C)
*/
current_locale = g_strdup (setlocale (LC_CTYPE, NULL));
/* Set the 'initialized' flag.
*/
- initialized = TRUE;
+ gtk_initialized = TRUE;
}
void
static void
gtk_exit_func (void)
{
- if (initialized)
+ if (gtk_initialized)
{
- initialized = FALSE;
+ gtk_initialized = FALSE;
gtk_preview_uninit ();
}
}
g_free (mem);
}
+GList*
+gtk_type_children_types (GtkType type)
+{
+ GtkTypeNode *node;
+
+ LOOKUP_TYPE_NODE (node, type);
+ if (node)
+ return node->children_types;
+
+ return NULL;
+}
+
void
gtk_type_describe_heritage (GtkType type)
{
GtkTypeNode *node;
- gint first;
+ gboolean first;
LOOKUP_TYPE_NODE (node, type);
first = TRUE;
}
void
-gtk_type_describe_tree (GtkType type,
- gint show_size)
+gtk_type_describe_tree (GtkType type,
+ gboolean show_size)
{
GtkTypeNode *node;
GtkType gtk_type_parent (GtkType type);
gpointer gtk_type_class (GtkType type);
gpointer gtk_type_parent_class (GtkType type);
+GList* gtk_type_children_types (GtkType type);
gpointer gtk_type_new (GtkType type);
void gtk_type_free (GtkType type,
gpointer mem);